<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Encrypt extends CI_Controller {


	public function encode()
	{
		$this->load->library('encrypt');

		$msg = 'i am eric!';

		echo $this->encrypt->encode($msg);

		echo '<br>'.$this->encrypt->encode($msg,'another key');
	}

	function decode()
	{
		$this->load->library('encrypt');

		$encrypted_string = 'bUUDkrlD8al5eLMtDUl4hcQoDkXuvxlqDJt1H8dvE8jjyoEg34mdNe3ebEsfNN1h33r7qvys5JK3YrXgiAZ7xA==';

		echo $this->encrypt->decode($encrypted_string);

		echo '<br>'.$this->encrypt->decode('LgDL6iswRmJi9l4M9UkCp6JEmK6wCwhbQajDB/0AnPMUnnjyNlcPPG5ht7PYeGsjatHqr5FcF+uICqr+VrLmlw==','another key');

	}

	function sha()
	{
		$this->load->library('encrypt');

		echo $this->encrypt->sha1('Some string');

		echo '<br>'.sha1('Some string');

	}
}

/* End of file encrypt.php */
/* Location: ./application/controllers/encrypt.php */